﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

#pragma once
#include "GcmpUiViewInterface.h"

namespace gcmp
{
    class IGcmpUserDrag;
    class IUserDragEvent;

    /// \brief 用户拖放管理器工厂类
    FINAL_INTERFACE class GCMP_UI_VIEW_INTERFACE_EXPORT IGcmpUserDragFactory
    {
    public:
        virtual ~IGcmpUserDragFactory();

        /// \brief 获取用户拖放管理器工厂类对象
        /// \return nullptr-获取失败；非nullptr-获取成功
        static IGcmpUserDragFactory* Get();

        /// \brief 创建一个用户拖放管理器实例
        /// \param dragSourceId 拖放时源控件的id (例如 UiViewId 、Qt 控件中的 effectiveWinId() 等)
        ///  无需手动析构，会在拖放结束后自动析构
        /// \return 用户拖放管理器的指针
        virtual IGcmpUserDrag* CreateUserDrag(UInt64 dragSourceId) = 0;

        /// \brief 获得拖动事件
        ///
        /// \return 拖动事件的指针
        virtual IUserDragEvent* GetEvent() = 0;
    protected:
        static IGcmpUserDragFactory* ms_pUserDragFactory;
    };

}